<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>模板</title>
</head>
<body>
    <h2 class="title">
        <img src="./img/a.jpg" alt="">
        花朵风景
    </h2>
    <img :src="imgArr[index]" alt="" />
    <a href="javascript:void(0)" v-if="index!=0" @click="prev" class="left">
        <img src="./img/start.png" alt="" />
        </a>
        
        <a href="javascript:void(0)" v-show="index<imgArr.length-1" @click="next" class="right">
            <img src="./img/right.png" alt="" />
            </a>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        //3.创建Vue实例
        var app=new Vue({
            el:"#mask",
            data:{
                imgArr: [
                    "./img/a.jpg",
                    "./img/aa.jpg",
                    "./img/bb.jpg",
                    "./img/c.jpg",
                    "./img/cc.jpg",
                    "./img/d.jpg",
                    "./img/dd.jpg",
                    "./img/ee.jpg",
                    "./img/ff.jpg",
                    "./img/aa.jpg",
                    "./img/ee.jpg",
                ],
                index:0
            },
            methods:{
                prev:function(){
                    this.index--;
                },
                next:function(){
                    this.index++;
                }
            },
        })
        </script>
</body>
</html>